Group motion profile

A motion profile defines how fast a group moves and the way it accelerates and decelerates. In a profile you can define the unit of acceleration and jerk, and limit the maximum of velocity, acceleration, deceleration, and jerk. Single-axis profiles will be used if you don't set any group profiles, or group profiles cannot be used.

The priority of group motion profile is higher than single-axis. If you have set both group and single-axis motion profiles and applied them to your group, the group will follow group motion profile, but the values in group profiles cannot be greater than those in single axis. The velocity of a group cannot be greater than the total amount of the velocity (path velocity) of the axes. The path velocity's formula is . For example, if you have three axes and their velocity is 2000, 3000, and 2000, but you set group's velocity to 5000 in a group motion profile. Your group cannot reach this velocity, because the path velocity is around 4123.

Keep the following in mind:

The unit of acceleration and jerk

Before you move a group, you can decide the unit of acceleration and jerk, which is described in the McProfileType type. The unit determines how an axis accelerates and decelerates.

Code

To create a group motion profile, use SetGroupParameter to set each motion parameter. In GroupConfiguration.cpp, add the following code:

Copy
VOID MotionProfileGroup(int Group)
{
    RtPrintf("Create a motion profile for Group %d.\n", Group);

    KsCommandStatus MotionProfile = SetGroupParameter(Group, mcMotionProfileTypeACS,
        MOTION_GROUP_PROFILE_TYPE, mcImmediately);
    if (MotionProfile.Error)
        RtPrintf("SetGroupParameter failed: %d\n", MotionProfile.ErrorId);

    KsCommandStatus Velocity = SetGroupParameter(Group, mcMaxVelocityACS,
        MAXIMUM_GROUP_VELOCITY, mcImmediately);
    if (Velocity.Error)
        RtPrintf("SetGroupParameter failed: %d\n", Velocity.ErrorId);

    KsCommandStatus Acceleration = SetGroupParameter(Group, mcMaxAccelerationACS,
        MAXIMUM_GROUP_ACCELERATION, mcImmediately);
    if (Acceleration.Error)
        RtPrintf("SetGroupParameter failed: %d\n", Acceleration.ErrorId);

    KsCommandStatus Deceleration = SetGroupParameter(Group, mcMaxDecelerationACS,
        MAXIMUM_GROUP_DECELERATION, mcImmediately);
    if (Deceleration.Error)
        RtPrintf("SetGroupParameter failed: %d\n", Deceleration.ErrorId);

    KsCommandStatus Jerk = SetGroupParameter(Group, mcMaxJerkACS, MAXIMUM_GROUP_JERK,
        mcImmediately);
    if (Jerk.Error)
        RtPrintf("SetGroupParameter failed: %d\n", Jerk.ErrorId);

    RtPrintf("\n");
}